package com.slz3.business.module.memberManagement.Feedback.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.memberManagement.Feedback.domain.Feedback;
import com.slz3.business.module.memberManagement.Feedback.domain.FeedbackCondition;
import org.springframework.stereotype.Controller;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

import javax.annotation.Resource;

public class FeedbackResController extends FeedbackResAtomic {

    public Mono<ServerResponse> add(ServerRequest req, Feedback Feedback) {
        if (FeedbackResUnsafeValid.add(req, Feedback)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.add_$FeedbackUpdateLock(req, Feedback);
        }
    }

    public Mono<ServerResponse> delete(ServerRequest req, FeedbackCondition FeedbackCondition) {
        if (FeedbackResUnsafeValid.delete(req, FeedbackCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.delete_$FeedbackUpdateLock(req, FeedbackCondition);
        }
    }

    public Mono<ServerResponse> modify(ServerRequest req, Feedback Feedback) {
        if (FeedbackResUnsafeValid.modify(req, Feedback)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.modify_$FeedbackUpdateLock(req, Feedback);
        }
    }

    public Mono<ServerResponse> list(ServerRequest req) {
        if (FeedbackResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.list(req);
        }
    }

    public Mono<ServerResponse> info(ServerRequest req) {
//        return FeedbackResAtomic.info_$FeedbackUpdateLock(req);
        if (FeedbackResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.info_$FeedbackUpdateLock(req);
        }
    }

    public Mono<ServerResponse> choice(ServerRequest req) {
        if (FeedbackResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.choice(req);
        }
    }

    public Mono<ServerResponse> auditSubmit(ServerRequest req, FeedbackCondition FeedbackCondition) {
        //
        if (FeedbackResUnsafeValid.auditSubmit(req, FeedbackCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditSubmit_$FeedbackUpdateLock(req, FeedbackCondition);
        }
    }

    public Mono<ServerResponse> audit(ServerRequest req, FeedbackCondition FeedbackCondition) {
        if (FeedbackResUnsafeValid.audit(req, FeedbackCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.audit_$FeedbackUpdateLock(req, FeedbackCondition);
        }
    }

    public Mono<ServerResponse> auditReject(ServerRequest req, FeedbackCondition FeedbackCondition) {
        if (FeedbackResUnsafeValid.auditReject(req, FeedbackCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditReject_$FeedbackUpdateLock(req, FeedbackCondition);
        }
    }

    public Mono<ServerResponse> usingEnable(ServerRequest req, FeedbackCondition FeedbackCondition) {
        if (FeedbackResUnsafeValid.usingEnable(req, FeedbackCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingEnable_$FeedbackUpdateLock(req, FeedbackCondition);
        }
    }

    public Mono<ServerResponse> usingDisable(ServerRequest req, FeedbackCondition FeedbackCondition) {
        if (FeedbackResUnsafeValid.usingDisable(req, FeedbackCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingDisable_$FeedbackUpdateLock(req, FeedbackCondition);
        }
    }

}
